import java.util.Scanner;

public class Test3 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int j =0;
        j = 100;
        int[] A = new int[6];
        int[] B = new int[3];
        j = 0;
        while (j<3) {
            A[j]= sc.nextInt();
            j++;
        }
        j =0;
        while (j<3) {
            B[j]= sc.nextInt();

        }

        int m = A.length;
        int n = B.length;





        Solution sol = new Solution();


        sol.merge(A,m,B,n);

    }

    public static void create() {



    }

}
class Solution {


    /*@Override
    public String toString() {
        return ;
    }*/

    public void merge(int A[], int m, int B[], int n) {

        int k = m-1;//最大元素存放的位置（下标）

        m = m - n - 1;

        while(m>=0 && k>=0){

            if(A[m]<B[n]){

                A[k--]=B[n--];

            }else {

                A[k--]=A[m--];

            }

        }

        while(m>=0){
            A[k--]=A[m--];
        }
        while(n>=0){
            A[k--]=B[n--];
        }


        System.out.println(A);

    }
}
